#include "conn.hpp"

int main(){
    StringUtil::UrlParam params;
    MYSQL* conn;
    Init(params,conn); 


    //根据业务需要进行计算
    string keyword = params["keyword"];
    string cookie_keyword = params["cookie_keywoed"];
    if(keyword.empty())
        keyword = cookie_keyword;
    string user = params["user"];
    string page = params["page"];
    stringstream ss;
    string output;
   
    Action::ActionSearch(conn,output,keyword,user,page);

    cout << "Set-Cookie: cookie_keyword=" << keyword << "\n"; 
    cout << "Set-Cookie: cookie_page=" << page << "\n"; 
    
    ss << output;
    HttpResponse(ss.str());
    return 0;
}
